import { Column, Entity, Index } from "typeorm";

@Index("idx_srp_permission_id", ["permissionId"], {})
@Index("idx_srp_role_id", ["roleId"], {})
@Index("idx_srp_role_per_id", ["roleId", "permissionId"], {})
@Entity("sys_role_permission", { schema: "workflow" })
export class SysRolePermission {
    @Column("char", { primary: true, name: "id", length: 36 })
    id: string;

    @Column("char", {
        name: "role_id",
        nullable: true,
        comment: "角色id",
        length: 36,
    })
    roleId: string | null;

    @Column("char", {
        name: "permission_id",
        nullable: true,
        comment: "权限id",
        length: 36,
    })
    permissionId: string | null;
}
